// ignore_for_file: prefer_typing_uninitialized_variables, must_be_immutable

import 'package:aitao_flutter/style/color_style.dart';
import 'package:flutter/cupertino.dart';
class CommonSwitchWidget extends StatefulWidget {
  CommonSwitchWidget({Key? key,required this.isSelect,required this.switchCallBack}) : super(key: key);
  bool isSelect;
  final switchCallBack;
  @override
  State<CommonSwitchWidget> createState() => _CommonSwitchWidgetState();
}

class _CommonSwitchWidgetState extends State<CommonSwitchWidget> {
  @override
  Widget build(BuildContext context) {
    return CupertinoSwitch(activeColor: ColorStyle.themeColor,value: widget.isSelect, onChanged: (e){
        setState(() {
          widget.isSelect = e;
        });
        widget.switchCallBack(widget.isSelect);
    });
  }
}
